package com.mz.mattress.admin.api.merchant;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mz.mattress.admin.api.req.BlackQueryReq;
import com.mz.mattress.admin.common.Holder;
import com.mz.mattress.admin.service.OrderUseTimesService;
import com.mz.mattress.api.common.Constants;
import com.mz.mattress.api.common.Result;
import com.mz.mattress.api.jwt.MerchantJwt;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping(Constants.MERCHANT_PATH + "orderUseTimes")
public class OrderUseTimesController {

    @Autowired
    private OrderUseTimesService orderUseTimesService;

    @GetMapping("/listMobilePage")
    public Result<IPage<String>> listMobilePage(BlackQueryReq req) {

        MerchantJwt userJwt = Holder.MERCHANT_JWT_THREAD_LOCAL.get();
        log.info("typeId={}", userJwt.getTypeId());
        req.setMerchantId(userJwt.getTypeId());
        return orderUseTimesService.selectMobileByMerchantId(req);

    }


}
